<?php
/**
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file license.txt or that can be found at 
 * http://code.google.com/p/billboardce/wiki/License.
 *
 * @package    Ot_Form_Tempate
 * @category   Library
 * @license    http://code.google.com/p/billboardce/wiki/License New BSD License
 * @version    SVN: $Id: $
 */

/**
 * Create default form templates from commonly used forms
 *
 * @package   Ot_Form_Template
 * @category  Library
 *
 */
class Ot_Form_Decorator_Imageupload extends Zend_Form_Decorator_Abstract 
{
	public function render($content)
	{
		$output = '<img id="' 
		        . $this->getOption('id') 
		        . '" src="' 
		        . $this->getOption('src') 
		        . '" alt="'
		        . $this->getOption('alt')
		        . '" style="display:block'
		        . '" />';
		
		$content = explode('<input', $content);
		
		return array_shift($content) . $output . '<input' . implode('', $content);
	}
}